<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // function Person(name,age) {
    //   this.name = name
    //   this.age = age
    // }
    // Person.prototype.sayName = function() {
    //   return this.name
    // }
    // let p1 = new Person('will',24)
    // class Teacher {
    //   constructor(name,age) {
    //     this.name = name
    //     this.age = age
    //   }
    //   sayName () {
    //     return this.name
    //   }
    // }
    // let t1 = new Teacher('will',24)

    class Person {
      constructor() {
        this.name = 'will'
      }
      *createNicknameIterator () {
        yield 'Jack'
        yield 'Jake'
        yield 'J-Dog'
      }
      static *createJobIterator () {
        yield 'Butcher'
        yield 'Baker'
        yield 'Candlestick maker'
      }
    }
    let p = new Person()
  </script>
</body>

</html>
